/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validUsername(str) {
  // const valid_map = ['xiaosheng','fengxiuyu','menggeyyds','admin',"xiaoweiyyds", 'xiaofan',"weiqixian"]//与后台数据库管理员名匹配
  // return valid_map.indexOf(str.trim()) >= 0
  const name = /^\w{1,16}$/g
  const name1 = name.test(str)
  return name1
}
export function validUserpass(str) {
  const valid_map = ['123456']//与后台数据库管理员密码匹配
  return valid_map.indexOf(str.trim()) >= 0
}
